package com.tian.factory.abstractfactory;

import com.tian.factory.abstractfactory.factory.AoDIFactory;
import com.tian.factory.abstractfactory.factory.DaZhongFactory;
import com.tian.factory.abstractfactory.factory.IFactory;
import com.tian.factory.function.product.ICar;

/**
 * @author tiansongtao, Email:tiansongtao@up366.com
 * @date 2020/12/24 17:19
 */
public class AbstractFactoryMain {

    public static void main(String[] args) {
        IFactory aodi = new AoDIFactory();
        ICar car1 = aodi.createLowProduct();
        ICar car2 = aodi.createMiddleProduct();
        ICar car3 = aodi.createhighProduct();
        car1.drive();
        car2.drive();
        car3.drive();


        IFactory dazhong = new DaZhongFactory();
        ICar car4 = dazhong.createLowProduct();
        ICar car5 = dazhong.createMiddleProduct();
        ICar car6 = dazhong.createhighProduct();
        car4.drive();
        car5.drive();
        car6.drive();

    }
}
